--[[
title: Utils
description: 工具函数
]]

-- 三目运算
function commonlib.if_else(b, t, f)
    if (b) then 
        return t;
    else
        return f;
    end
end

commonlib.NewEnv = function(env)
	return setmetatable({}, {
		__index = env or _G,
		__call = commonlib.NewEnv,
	});
end

-- ============================================C++==========================================================
-- ms
commonlib.GetTimeStamp = function()
	return LuaGui.GetTimeStamp();
end

commonlib.GetTimerInterval = function()
	return LuaGui.GetTimerInterval();
end

commonlib.Sleep = function(ms)
	return LuaGui.Sleep(ms or 0);
end

return commonlib;